<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <em>em</em>
    <div class="box" abc="hahaha" id="cont" title="这是一个title">
        <span>1</span>
        hello
        <!-- 这是一个注释 -->
        <span>2</span>
    </div>
    <p>p</p>
</body>
<script>
    var obox = document.querySelector(".box")

    // 获取子元素节点
    console.log(obox.children)

    // 获取所有子节点
    console.log(obox.childNodes)

    console.log(obox.firstChild)
    console.log(obox.lastChild)
    console.log(obox.previousSibling)
    console.log(obox.nextSibling)

    // 获取根节点
    console.log(document);
    console.log(obox.ownerDocument);
    console.log(obox.ownerDocument === document);

    // 获取属性节点
    console.log(obox.attributes);

</script>
</html>